package com.lza.security;

import com.lza.response.Result;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 *
 * 注销成功handler
 */
@Component
public class LogoutSuccessHandler extends JSONAuthentication implements org.springframework.security.web.authentication.logout.LogoutSuccessHandler {
    @Override
    public void onLogoutSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException {
        Result result=Result.ok().getMessage("注销成功");
        this.WriteJSON(httpServletRequest, httpServletResponse, result);
    }
}
